<!-- CustomModal -->
<template>
  <div id="CustomModal">
    <el-dialog
      v-if="dialogVisible"
      :title="dialogTitle"
      :close-on-click-modal="false"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="DialogClose"
    >
      <div class="dialog_content">
        <slot />
      </div>
      <span slot="footer" class="dialog_footer">
        <el-button size="mini" plain type="warning" @click="DialogClose">取 消</el-button>
        <el-button size="mini" type="primary" @click="DialogOk">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'CustomModal',
  props: {
    dialogTitle: {
      type: String,
      default: ''
    },
    dialogVisible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {

    }
  },
  /* HTML DOM加载后马上执行的，如赋值*/
  computed: {},

  /* 观察Vue实例上的数据变动 */
  watch: {},

  /* 模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图 */
  created() {},

  /* 模板渲染成html后调用，通常是初始化页面完成后，再对html的dom节点进行一些需要的操作 */
  mounted() {},

  /* methods则必须要有一定的触发条件才能执行 */
  methods: {
    /**
     * @date: 2024-10-30 23:43:49
     * @description: dialog取消
     * @modifyContent:
     * @author: Forever丿顾北
    **/
    DialogClose() {
      this.$emit('DialogClose')
    },
    /**
     * @date: 2024-10-30 23:45:49
     * @description: dialog确定
     * @modifyContent:
     * @author: Forever丿顾北
    **/
    DialogOk() {
      this.$emit('DialogOk')
    }
  }
}
</script>

<style lang='scss' scoped>

</style>
